<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" >
	<title>约教定价</title>
	<link rel="stylesheet" href="../vender/css/normalize.css">
	<link rel="stylesheet" href="prise.css">
</head>
<body>
<header>
	<img src="../public_img/return.png"  alt="返回"
onclick="history.back(-1)">
	<p>约教定价</p>
</header>
<section>
	<ul>
		<li>
			<span>科二定价</span>
			<form>
				<input type="text" class="mutow">元/小时
			</form>
		</li>
		<li>
			<span>科三定价</span>
			<form>
				<input type="text" class="muthree">元/小时
			</form>
		</li>
	</ul>
</section>
 <div style="width:100% ; text-align: center">
                <button class='return' style="padding: 0.06rem 1rem;border-radius: 2rem;font-size: 0.2rem;background-color:  #FC9E16;color: #fff;border: none"> 确认</button>
            </div>
<script src="../info/jquery.min.js"></script>
<script src="../vender/src/picturefill.js"></script>
<script src="../layer.js"></script>
<script type="text/javascript">

	$(function () {
		var price1=localStorage.place1;
		var price2=localStorage.place2;
		$('.mutow').val(price1);
		$('.muthree').val(price2);
	})
$(".return").click(function(){
	var mutow = $(".mutow").val();
	if(mutow==''){
		layer.msg('请输入价格');
		return false;
	}
	if(!/^[0-9]*$/.test(mutow)){
		layer.msg("请输入数字");
		return false;
	}
	var muthree = $(".muthree").val();
	if(muthree==''){
		layer.msg('请输入价格');
		return false;
	}
	if(!/^[0-9]*$/.test(muthree)){
		layer.msg("请输入数字");
		return false;
	}
	var token = localStorage.phone;
	$.ajax({
		url:'https://newapp.icandrive.cn/api/price.php',
		dataType:'json',
		data:{token:token,muthree:muthree,mutow:mutow},
		type:'post',
		success:function(data){
			if(data.status==250){
            layer.msg('请重新登录',function(){
                window.location.href="../login/log_in.html";
            },2000)
		}
		if(data.status==200){
			layer.msg('修改成功',function(){
                history.back();
            },2000)
		}
		if(data.status==400){
			layer.msg('操作失败');
		}
	},
	error:function(){
		 layer.msg('系统维护中',function(){
                                history.go(0)
                            },1000);
	}
	});
});
</script>

    <script>
    document.addEventListener("plusready", function() {
        // 注册返回按键事件
        plus.key.addEventListener('backbutton', function() {
            window.history.back();
        }, false);
        //此处false代表不退出页面，如果为true回退到上一个一面
    });
</script>
</body>
</html>
